/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vita.vitasolution.service.util.converters;

import vita.vitasolution.db.entities.Criterion;
import vita.vitasolution.service.dto.ShortCriterion;

/**
 *
 * @author Iaroslav_Mazai
 */
public class CriteriaShortCriteriaConverter implements EntityDtoConverter<Criterion, ShortCriterion> {

	@Override
	public Criterion getEntityFromDto(ShortCriterion shortCriteria) {
		Criterion criteria = new Criterion();

		criteria.setId(shortCriteria.getId());
		criteria.setMust(shortCriteria.getMust());
		criteria.setTitle(shortCriteria.getTitle());

		return criteria;
	}

	@Override
	public ShortCriterion getDtoFromEntity(Criterion criteria) {
		ShortCriterion shortCriteria = new ShortCriterion();

		shortCriteria.setId(criteria.getId());
		shortCriteria.setMust(criteria.getMust());
		shortCriteria.setTitle(criteria.getTitle());

		return shortCriteria;
	}
}
